<template>
  <div class="col-md-8">
    <h3 class="reply">评论回复：</h3>
    <h2 v-if="comments.length===0">暂无评论，点击左侧添加评论！！！</h2>
    <ul class="list-group" v-else>
      <comment-item 
        v-for="item in comments" 
        :key="item.id" 
        :comment="item" 
        :deleteComment="deleteComment"
      />
    </ul>
  </div>
</template>

<script>
import CommentItem from './CommentItem.vue';
export default {
  components: { CommentItem },
  name: 'CommentList',
  props: {
    comments: Array,
    deleteComment: Function
  }
};
</script>

<style scoped>
.reply {
  margin-top: 0px;
}
</style>
